home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # preinst script for cupsys
- #
- # see: dh_installdeb(1)
-
- set -e
-
- # summary of how this script can be called:
- # * <new-preinst> `install'
- # * <new-preinst> `install' <old-version>
- # * <new-preinst> `upgrade' <old-version>
- # * <old-preinst> `abort-upgrade' <new-version>
-
- case "$1" in
- install)
- ;;
-
- upgrade)
- if dpkg --compare-versions "$2" le 1.1.23-6; then
- [ -f /etc/cups/printers.conf ] && mv /etc/cups/printers.conf /etc/cups/printers.conf.save
- [ -f /etc/cups/classes.conf ] && mv /etc/cups/classes.conf /etc/cups/classes.conf.save
- fi
- if [ -e /var/lib/cups/conf -a ! -L /var/lib/cups/conf -a ! -e /etc/cups ]; then
- echo -n "Moving configuration files..."
- mkdir -p /etc/cups || true
- if [ `ls /var/lib/cups/conf | wc -l` -ne " 0" ]; then
- cp -a /var/lib/cups/conf/* /etc/cups
- fi
- rm -rf /var/lib/cups/conf
- echo "done."
- fi
-
- if [ -e /var/lib/cups/ppd -a ! -L /var/lib/cups/ppd -a ! -e /etc/cups/ppd ]; then
- echo -n "Moving printer definition files..."
- mkdir -p /etc/cups/ppd || true
- if [ `ls /var/lib/cups/ppd | wc -l` -ne " 0" ]; then
- cp -a /var/lib/cups/ppd/* /etc/cups/ppd
- fi
- rm -rf /var/lib/cups/ppd
- echo "done."
- fi
-
- if [ -e /var/lib/cups/logs -a ! -L /var/lib/cups/logs ]; then
- rmdir /var/lib/cups/logs || true
- fi
-
- # Remove dangling pdftops.conf symlink, which is obsolete anyway
- if [ -L /etc/cups/pdftops.conf -a ! -e /etc/cups/pdftops.conf ]; then
- rm -f /etc/cups/pdftops.conf
- fi
-
- # Remove obsolete /etc/cups/certs
- [ -L /etc/cups/certs ] && rm -f /etc/cups/certs || true
-
- # Fix global SSL certificate owner/mode breakage
- if dpkg --compare-versions "$2" lt-nl '1.2.1-2ubuntu2'; then
- if [ -e /etc/ssl/certs/ssl-cert-snakeoil.pem ]; then
- chown root:root /etc/ssl/certs/ssl-cert-snakeoil.pem
- chmod 0644 /etc/ssl/certs/ssl-cert-snakeoil.pem
- fi
- if [ -e /etc/ssl/private/ssl-cert-snakeoil.key ]; then
- chown root:ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key
- chmod 0640 /etc/ssl/private/ssl-cert-snakeoil.key
- fi
- fi
- ;;
-
- abort-upgrade)
- ;;
-
- *)
- echo "preinst called with unknown argument \`$1'" >&2
- exit 0
- ;;
- esac
-
- # dh_installdeb will replace this with shell code automatically
- # generated by other debhelper scripts.
-
-
-
- exit 0
-
-
-